package com.q.springboot;


import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * @author ：qmf
 * @date ：Created in 2021/11/12 18:18
 * @description：
 * @modified By：
 */
public class AS {

    public static void main(String[] args) throws Exception {
        L1 l1 = new L1(2, 2,"11");
        L1 l2 = new L1(2, 4,"5");
        L1 l3 = new L1(2, 3,"10");
        List<L1> l1s = Arrays.asList(l1, l2, l3);
        System.out.println("排序前" + l1s);
        Comparator<L1> idcom = Comparator.comparing(L1::getId);
        System.out.println("排序后" + l1s);

    }

    @Data
    @AllArgsConstructor
    public static class L1 {
        private int id;
        private int age;
        private String name;
    }
}

